package com.google.webmusic.util;

import java.util.List;
import java.util.Map;

import javax.websocket.Session;

import org.apache.log4j.Logger;

public class RequestUtil {
	private RequestUtil(){}
	public static String getParameter(Map<String, List<String>> params, String key){
		List<String> values=params.get(key);
		if(values==null||values.isEmpty()) return null;
		return values.iterator().next();
	}
	
	public static void debugSession(Session s, Logger log){
		log.debug(s.getRequestParameterMap());
		log.debug(s.getPathParameters());
		log.debug(s.getQueryString());
		log.debug(s.getRequestURI());
		log.debug(s.getUserProperties());
	}
}
